<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    input {
      text-align: right;
      font-size: 20px;
    }
  </style>
</head>

<body>
  Minutes: <input type="text" value="0">
  Seconds: <input type="text" value="0">
  <script src="/定时器/定时器.js"></script>
  <script>
    // 
    let minutesCount = 0
    let secondsCount = 0
    const minutesInput = document.getElementsByTagName('input')[0]
    const secondsInput = document.getElementsByTagName('input')[1]
    let intervalTimer = setInterval(() => {
      secondsCount++
      secondsInput.value = secondsCount % 60
      minutesInput.value = Math.floor(secondsCount / 60)
      if (minutesInput.value === '3') {
        clearInterval(intervalTimer)
      }
    }, 1000)
  </script>
</body>

</html>